const DESIGN_WIDTH = 750
const rootDom = document.querySelector('html')

function adapt() {
    const documentWidth = document.documentElement.clientWidth
    rootDom.style.fontSize = (documentWidth / DESIGN_WIDTH) * 100 + 'px'
}

adapt()

window.addEventListener('resize', adapt)